<h6 style="font-weight: bolder">经甲乙双方确认根据下列条款订立本合同：</h6>
<div class="box-body table-responsive no-padding" style="max-height: 600px;">
    <table class="table table-hover">
        <thead>
        <tr>
            <th width="10%">SKU</th>
            <th width="10%">产品名称</th>
            <th width="10%">图片</th>
            <th width="34%">产品描述</th>
            <th width="8%">单价(RMB)</th>
            <th width="6%">数量(PCS)</th>
            <th width="10%">总额(RMB)</th>
            <th width="12%">交货日期</th>
        </tr>
        </thead>
        <tbody>
        @php
            $orderNum = 0;
            $orderAmount = 0;
        @endphp
        @foreach($purchase->order_detail as $item)
            @php
                $orderNum += $item->order_num ?: 0;
                $orderAmount += round(($item->unit_price ?:0) * ($item->order_num?:0),3);
            @endphp
            @if($item->order_num != 0)
                <tr>
                    <td>{{ $item->sku->psku_code ?? '' }}</td>
                    <td>{{ $item->sku->psku_cn ?? '' }}</td>
                    <td>{!! \App\Models\Product\ProductSku::getMainImage($item->sku->img ?? null) !!}</td>
                    <td>
                    <textarea name="param[{{ $item->id }}][describe]" style="text-align: left;width: 100%;">
{{ $item->sku->psku_describe }}
                    </textarea>
                    </td>
                    <td>{{ $item->unit_price }}</td>
                    <td>{{ $item->order_num }}</td>
                    <td>{{ round(($item->unit_price ?:0) * ($item->order_num?:0),3) }}</td>
                    <td>{{ date('Y-m-d',strtotime('-7 days',strtotime($purchase->commit_date))) }}</td>
                </tr>
            @endif
        @endforeach
        <tr>
            <td style="font-weight: bolder">合计</td>
            <td style="font-weight: bolder">
                @if($supplier->tax > 0)
                    <input type="text" class="form-copy" name="param[tax]" value="含{{ $supplier->tax }}点税" placeholder="税">
                @else
                    <input type="text" class="form-copy" name="param[tax]" value="不含税" placeholder="税">
                @endif
            </td>
            <td style="font-weight: bolder">
                <select id="ship_fee_type" name="param[ship_fee_type]">
                    {{ getOptions(\App\Models\Basics\Supplier::$_shipFeeType,$supplier->ship_fee_type ?: 1) }}
                </select>
            </td>
            <td></td>
            <td></td>
            <td style="font-weight: bolder">{{ $orderNum }}</td>
            <td style="font-weight: bolder">{{ $orderAmount }}</td>
            <td></td>
        </tr>
        </tbody>
    </table>
</div>
<script language="JavaScript" type="text/javascript">
    $(function () {
        $("#ship_fee_type").select2({"placeholder":"运费类型","width": '100%'});
    });
</script>
